﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Buckets.ascx.cs" Inherits="Controls_Admin_Collection_Buckets" %>
<asp:ScriptManagerProxy runat="server">
	<Services>
		<asp:ServiceReference Path="~/Manager/Admin/Users/Users.asmx" />
	</Services>
</asp:ScriptManagerProxy>
<link href="Buckets.css" rel="stylesheet" type="text/css" />
<div id="element" runat="server">
<table border="1" class="ColectionBuckets" style="border:none">
	<tr>
		<td rowspan="2">
			<fieldset id="Collectors"><legend class="Header">Collectors</legend>
				<ul class="ulUsers" style="height:300px;overflow:auto">
					<asp:LinqDataSource id="dsCollectors" runat="server" />
					<asp:Repeater ID="Repeater1" DataSourceID="dsCollectors" runat="server">
						<ItemTemplate>
							<li login='<%#Eval("Login")%>' class='<%#Eval("Class") %>'><%#Eval("DisplayName")%></li>
						</ItemTemplate>
					</asp:Repeater>
					<li class="user_Empty">Empty</li>
				</ul>
			</fieldset>
		</td>
		<td align="center" valign="bottom" colspan="100" height="1px" class="Header">Buckets</td></tr>
	<tr>
		<asp:LinqDataSource ID="dsCollectionContainers" runat="server" />
		<asp:Repeater DataSourceID="dsCollectionContainers" runat="server">
			<ItemTemplate>
		<td style="height:99%">
			<div class="CompanyCode">
				<asp:Literal ID="CollectionContainer" Text='<%#Eval("CompanyCode")%>' runat="server" />
							[<span class="Accounts" title="Acoounts to be collected today"><%#Eval("Accounts")%></span> /
							<span class="LoansPerDay" title="Speed in Account per Day Per Company"><%#Eval("LoansPerDay")%>]</span> = <span class="Ratio"><%#Eval("Ratio")%></span>%]
			</div>
			<asp:LinqDataSource ID="dsCollectionBuckets" OnSelecting="dsCollectionBuckets_Selecting" runat="server" >
				<WhereParameters>
					<asp:ControlParameter Name="Container" ControlID="CollectionContainer" PropertyName="Text" Type="String" />
				</WhereParameters>
			</asp:LinqDataSource>
			<asp:Repeater DataSourceID="dsCollectionBuckets" runat="server">
				<ItemTemplate>
					<fieldset>
						<legend>
							<span class="GroupName"><%#Eval("GroupName")%></span> 
							[<span class="Accounts" title="Acoounts to be collected today"><%#Eval("Accounts")%></span>/
							<span class="LoansPerDay" title="Speed in Account per Day Per Bucket"><%#Eval("LoansPerDay")%>]</span>=<span class="Ratio"><%#Eval("Ratio")%></span>]
							<img src="/images/Buttons/Garbage.gif" style="float:left;margin-top:-17px;display:none" alt="Drop here to remove collector from Bucket" />
						</legend>
						<ul class="ulBuckets">
							<li class="user_Empty">Empty</li>
							<asp:Literal ID="SID_Group" Text='<%#Eval("SID")%>' Visible="false" runat="server" />
							<asp:LinqDataSource ID="dsCollectorsByBucket" OnSelecting="dsCollectorsByBucket_Selecting" runat="server">
								<WhereParameters>
									<asp:ControlParameter Name="SID" ControlID="SID_Group" PropertyName="Text" Type="String" />
								</WhereParameters>
							</asp:LinqDataSource>
							<asp:ListView ItemPlaceholderID="collectorsInBucket" DataSourceID="dsCollectorsByBucket" runat="server">
								<LayoutTemplate><asp:PlaceHolder ID="collectorsInBucket" runat="server" /></LayoutTemplate>
								<ItemTemplate><li login='<%#Eval("Login")%>'><span class="DisplayName"><%#Eval("DisplayName")%></span> [<span title="Loans Per Day"><%#Eval("LoansPerDay")%></span>]</li></ItemTemplate>
							</asp:ListView>
						</ul>
					</fieldset>
				</ItemTemplate>
			</asp:Repeater>
		</td>
			</ItemTemplate>
		</asp:Repeater>
	</tr>
</table>
<%--<input type="button" value="Syncronize" id="syncBucket" onclick='$find("<%=element.ClientID%>").serialize()' />--%>
</div>
